home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / CC_C / 0668.ZIP / BSAVE.SCR < prev    next >
Text File  |  1987-04-03  |  981b  |  32 lines

  1. N      BSAVE.COM
  2. A
  3. XOR    BH,BH
  4. MOV    BL,[80]               ;Get argument length.
  5. MOV    Byte Ptr [BX+81],0    ;Convert argument to ASCIIZ.
  6. MOV    DX,82
  7. MOV    CX,0
  8. MOV    AH,3C                 ;Create a normal file.
  9. INT    21
  10. JB     140                   ;Exit if error.
  11. MOV    BX,AX                 ;Else, filehandle in BX.
  12. MOV    AX,40
  13. MOV    DS,AX                 ;BIOS data segment.
  14. MOV    AX,B000               ;Monochrome buffer address.
  15. MOV    CX,1000               ;4K buffer.
  16. CMP    Word Ptr [63],3B4     ;Is it monochrome?
  17. JZ     133                   ;If yes, skip around.
  18. ADD    AX,800                ;Else, CGA buffer address.
  19. ADD    CX,3000               ;16K buffer.
  20. MOV    DS,AX                 ;Point to segment.
  21. MOV    DX,0                  ;Point to offset.
  22. MOV    AH,40                 ;Write image to file.
  23. INT    21
  24. MOV    AH,3E                 ;Close the file.
  25. INT    21
  26. INT    20                    ;Terminate.
  27.  
  28. RCX
  29. 42
  30. W
  31. Q
  32.